<%@ Page language="c#" Inherits="Dimok.Aspx.Manager.Tracking.Tracker_Car" CodeFile="Tracker_Car.aspx.cs" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<TITLE>Tracking -> VIN</TITLE>
<META name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1"><META name="CODE_LANGUAGE" Content="C#"><META name="vs_defaultClientScript" content="JavaScript"><META name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<?XML:NAMESPACE PREFIX="COOL"/>
<?XML:NAMESPACE PREFIX="DIMOK"/>
<?IMPORT namespace="DIMOK" implementation="/include/htc/datagrid.htc">
<LINK rel="stylesheet" type="text/css" href="/CSS/Outlook.css">
<SCRIPT src="/include/common.js"></SCRIPT>
<SCRIPT src="/include/soap.js"></SCRIPT>
<SCRIPT src="/include/XML.js"></SCRIPT>
<SCRIPT src="/include/RDS.js"></SCRIPT>
<SCRIPT src="/include/Events.js"></SCRIPT>
<SCRIPT src="/Manager/Common/Events.js"></SCRIPT>
<SCRIPT src="/Manager/Menu/Common/index_content.js"></SCRIPT>
<SCRIPT src="/Manager/Menu/index_content_NS.js"></SCRIPT>
<STYLE>
</STYLE>
</HEAD>
<BODY>
<TABLE>
	<TR align="center">
		<TD>Technician</TD>
		<TD>Trackers</TD>
	</TR>
	<TR>
		<TD><SELECT id="selTechnician" runat="server" style="FONT-FAMILY: Monospace" ondblclick="TechnicianTrackers(this)" onchange="TechnicianTrackers(this)" size="8"></SELECT></TD>
		<TD><SELECT id="selTechTrackers" size="8" style="FONT-FAMILY: Monospace" ondblclick="TechnicianTracker_Rem()"><OPTION>___________</OPTION></SELECT></TD>
	</TR>
</TABLE>
<TABLE datasrc="#rdsTechCars" id="tblTechCars" style="BEHAVIOR: url(/include/HTC/rowover_js.htc);display:none"
			 style="COLOR: navy; BORDER-COLLAPSE: collapse" bgcolor="WhiteSmoke" bordercolor="DimGray" border="1"
			 rowover="1" striped="0" selectable="1" onrowclick="showTrackerForm()">
	<THEAD><TR><TH>Loan</TH><TH>Car Description</TH><TH>VIN</TH><TH>Dealer</TH><TH>Status</TH></TR></THEAD>
	<TR bgcolor="White">
		<TD nowrap align="center"><SPAN datafld="LoanID" style="border:1 black solid;cursor:hand;background-color:white;color:black" onclick="event.cancelBubble=true;showApplInfo(this);"></SPAN></TD>
		<TD nowrap><SPAN datafld="Description"></SPAN></TD>
		<TD nowrap><SPAN datafld="VIN"></SPAN></TD>
		<TD nowrap><SPAN datafld="Dealer"></SPAN></TD>
		<TD nowrap><SPAN datafld="Status"></SPAN></TD>
		<TD><INPUT type="button" value="Add" onclick="return TrackerCar_Installed(this)"></TD>
	</TR>
</TABLE>
<OBJECT CLASSID="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33" ID="rdsTechCars" VIEWASTEXT height="0"></OBJECT>
<OBJECT CLASSID="clsid:BD96C556-65A3-11D0-983A-00C04FC29E33" ID="rdsTrackers" VIEWASTEXT height="0"></OBJECT>
</BODY>
</HTML>
<SCRIPT language="javascript">
initWS("Common","../Common/Common.asmx");
setTimeout(function(){cropWindow()},100);
function showTrackerForm(el){
	var loanID = rsField(el||event.srcRow,"LoanID");
	showModalDialog("TrackingForm.aspx?ApplID="+loanID,{opener:top},"status=0");
}
function TrackerCar_Installed(el){
	(event||{}).cancelBubble = true;
	if( !eval(selTechnician.value) )return alert("Select a technician");
	if( !selTechTrackers.value )return alert("Select a tracker");
	var vin = rsField(el,"VIN").value;
	var loanID = rsField(el,"LoanID").value;
	if( !confirm("Tracker: "+selTechTrackers.value+" -> VIN: "+vin) )return;
	var ret = WS(CO(getFuncName()),selTechTrackers.value,vin);
	if( showSOAPError(ret) )return;
	refreshTrackers(ret.value);
	fireTrackerRequestStatus(loanID);
	showTrackerForm(el);
}
function TechnicianTrackers(sel){
	var ret = WS(CO(getFuncName()),sel.value);
	if( showSOAPError(ret) )return;
	refreshTrackers(ret.value);
}
function refreshTrackers(xmlDS){
	fillSelect(getRSFromDS(xmlDS,"TechTrackers"),selTechTrackers,"TrackerID","TrackerID",selTechTrackers.value);
	rdsTechCars.sourceRecordset = getRSFromDS(xmlDS,"Cars");
	tblTechCars.style.display = rdsTechCars.recordset.recordCount ? "" : "none";
	setTimeout(function(){cropWindow()},500);
}
</SCRIPT>
